{include file="public/header"}
<body>
	<div class="sectionY">
		<a href="javascript:history.back();">
			<img src="__PUBLIC__/home/images/a19.png" alt="" class="a1">
		</a>
		<p class="p1">支付</p>
	</div>
	<div class="kong1" style=""></div>
	<div class="zhi_section1">
		<div class="zhi_section1_1 pay_code" data-src_url="{$base_url}{$pay_set.pay_code}">
			<a href="{$base_url}{$pay_set.pay_code}" download="收款二维码.png" style="display: none;"></a>
			<img src="{$pay_set.pay_code}" alt="">
			<p class="p1">长按二维码保存</p>
		</div>
		<div class="zhi_section1_2">
			<p class="p1">说明</p>
			<p class="p2">1.你可长按二维码保存，然后在微信或者支付宝扫码支付；</p>
			<p class="p2">2.如果你选择支付到银行卡，请在下面选择到账银行卡号，支付 即可</p>
		</div>
	</div>
	<div class="ge"></div>
	<div class="zhi_section2">
		<div class="title">
			<p class="p1">
				<span class="s1">选择到账银行卡</span>
				<span class="s2">（点击可复制卡号）</span>
			</p>
		</div>
		<div class="center">
			{foreach $pay_set.bank_list as $bank_list}
			<div class="f1 clearfix" onclick="copy('{$bank_list.bank_code}')">
				<span class="s1">{$bank_list.bank_name}（{$bank_list.bank_code}）</span>
				<img src="__PUBLIC__/home/images/a33.png" alt="" class="im1">
				<img src="__PUBLIC__/home/images/a34.png" alt="" class="im2">
			</div>
			{/foreach}
		</div>
	</div>
	<div class="kong"></div>
	<div class="zhi_footer">
		<a href="javascript:;" onclick="surePay('{$order_id}')">确定</a>
	</div>
</body>
<script>
	var is_app=0;
	try {
		is_app = android.getType();
	}catch (e) {

	}
	$(function(){
		$(".im1").click(function(){
			$(this).hide().siblings(".im2").show();
			$(this).parent().siblings().children(".im2").hide().siblings(".im1").show()
		})
		//长按事件
		var time = 0; //初始化起始时间
		$(".pay_code").on("touchstart", function(e) {
			e.stopPropagation();
			let o = this;
			time = setTimeout(function() {
				if(is_app== 1){
					showAlert($(o).data("src_url"));
				}else{
					$(o).find("a").trigger("click");
				}
			}, 500); //这里设置长按响应时间
		});
		$(".pay_code").on("touchend", function(e) {
			e.stopPropagation();
			clearTimeout(time);
		});
	})
	function showAlert(url) {
		android.saveImage(url);
	}
	function copy(code) {
		if(is_app == 1){
			android.copy(code);
		} else {

		}
	}
	
	function surePay(order_id) {
		modal.confirm("确定已支付订单？","确定", function () {
			location.replace("{:url('surePay')}?order_id="+order_id);
		})
	}

</script>
</html>